using FibMatrix;
using SleepyHippo.Util;
using UnityEditor;
using UnityEngine;

public class ResourceDebugEditorWindow : EditorWindow
{
    private static ResourceDebugEditorWindow s_instanse = null;

    [MenuItem("FMFramework/Game Resource Ref View")]
    static void ShowWindow()
    {
        if (s_instanse == null)
        {
            s_instanse = (ResourceDebugEditorWindow) GetWindow(typeof(ResourceDebugEditorWindow));
            s_instanse.titleContent = new GUIContent("Game Resource Ref View");
        }

        s_instanse.Show();
    }

    private Vector2 _scrollPos;

    void OnInspectorUpdate()
    {
        Repaint();
    }
    
    private void OnGUI()
    {
        _scrollPos = EditorGUILayout.BeginScrollView(_scrollPos);
        
        EditorGUILayout.LabelField("ResourceFacade:");
        EditorGUI.indentLevel++;
        ResourceFacade.InspectorGUI();
        EditorGUI.indentLevel--;
        
        EditorGUILayout.LabelField("GameObjectPool2:");
        EditorGUI.indentLevel++;
        GameObjectPool2.InspectorGUI();
        EditorGUI.indentLevel--;
        
        EditorGUILayout.EndScrollView();
    }
}